package com.test.controller;

import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import androidx.appcompat.app.AppCompatActivity;

import com.test.R;


/**
 * 适配器
 *
 * @Author Musique
 * 2020/8/1
 */
public class AdapterActive extends AppCompatActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.adapter_demo);

        ListView listView = findViewById(R.id.lv_data);

        String str[] = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o"};
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
                android.R.layout.simple_expandable_list_item_1, str);
        listView.setAdapter(adapter);
    }
}
